# Contributor: Dylan Van Assche <me@dylanvanassche.be>
# Maintainer: Dylan Van Assche <me@dylanvanassche.be>
pkgname=eg25-manager
pkgver=0.4.6
pkgrel=2
pkgdesc="Daemon for managing the Quectel EG25 modem"
url="https://gitlab.com/mobian1/devices/eg25-manager"
arch="all"
license="GPL-3.0-or-later"
makedepends="
	curl-dev
	glib-dev
	libgpiod-dev
	libgudev-dev
	libusb-dev
	meson
	modemmanager-dev
	"
source="
	https://gitlab.com/mobian1/devices/eg25-manager/-/archive/$pkgver/eg25-manager-$pkgver.tar.gz
	eg25-manager.confd
	eg25-manager.initd
	"
options="!check"  # no tests
subpackages="$pkgname-openrc"

build() {
	abuild-meson . output
	meson compile -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
	install -Dm755 "$srcdir"/eg25-manager.initd "$pkgdir"/etc/init.d/eg25-manager
	install -Dm644 "$srcdir"/eg25-manager.confd "$pkgdir"/etc/conf.d/eg25-manager

	rm -rf "$pkgdir"/usr/lib/systemd
}

sha512sums="
e3b1c6c56bab8c66295c186d7efc3082b3e1fcee5145b2f2f1cdc8c706958ad19aff341f00c03f161f23b1055e38393808590d6e05f5bf93f85cc01cc50fef0b  eg25-manager-0.4.6.tar.gz
55936830afad2968a214fb39cfe1a9db50421dc2ff4f67d04f08f6bd2b094c3ab46799cfc7743bbc5032682d98d1216203adf5264353a05134bea58524ac070b  eg25-manager.confd
5d1a4783ad7f8889e82fa6bb3ccd646777dfb577e1053b941dc8243b97adc97b3fe76cb4f70523f7c23f6c40cfce1e1ff1d13cab74873fc22ea0ebfb9012de45  eg25-manager.initd
"
